package com.magicsoft.share.adapter.exchange;

import android.support.annotation.LayoutRes;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.exchange.GoodsList;

/**
 *
 * @author lyf

 */

public class GoodsAdapter extends BaseQuickAdapter<GoodsList.ListBean, BaseViewHolder> {

    public GoodsAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsList.ListBean item) {
        helper.addOnClickListener(R.id.btn_buy);
        ImageView imageView = helper.getView(R.id.imageView);
        Glide.with(mContext).load(item.getGoodsImg()).into(imageView);
        helper.setText(R.id.tv_name,item.getGoodsName());
        helper.setText(R.id.tv_price,item.getPrice()+"");

    }


}
